<script setup lang="ts">

import { onMounted, reactive } from "vue";
import { useRouter, useRoute } from 'vue-router'
import { getOrderStatusMessge } from '@/utils/util'
const router = useRouter()
const route = useRoute()
const vdata = reactive({
    info: {
        id: 1,
        userName: '张三大大',
        name: '三',
        surname: '张',
        email: '57641088@qq.com',
        password: '123456',
        idCard: '513****************',
        phone: '136********',
        avatar: 'https://shadow.elemecdn.com/app/element/hamburger.9cf7b091-55e9-11e9-a976-7f4d0b07eef6.png',
        address1: '**省**市******街道**号*栋*单元**号',
        address2: '',
        address3: '',
        status: 1
    }
})
onMounted(() => {
    // console.log(route.query)
    // vdata.goods = { ...route.query }
    /**
     * 在这里调获取消息的接口
     */
})


</script>
<template>
    <div class="user_info_main">
        <div class="form_box">
            <el-form :model="vdata.info" label-width="auto">
                <el-row>
                    <el-col :span="12">
                        <el-form-item>
                            <div class="avatar_box">
                                <div class="avatar">
                                    <img :src="vdata.info.avatar" alt="" srcset="" />
                                </div>
                                <div class="label">会员</div>
                            </div>
                        </el-form-item>
                        <el-form-item label="昵称">
                            <el-input v-model="vdata.info.userName" />
                        </el-form-item>
                        <el-form-item label="密码">
                            <el-input type="password" v-model="vdata.info.password" />
                        </el-form-item>
                        <el-form-item label="姓">
                            <el-input v-model="vdata.info.surname" />
                        </el-form-item>
                        <el-form-item label="名">
                            <el-input v-model="vdata.info.name" />
                        </el-form-item>
                        <el-form-item label="邮箱">
                            <el-input v-model="vdata.info.email" />
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="手机号码">
                            <el-input v-model="vdata.info.phone" />
                        </el-form-item>
                        <el-form-item label="身份证">
                            <el-input v-model="vdata.info.idCard" />
                        </el-form-item>
                        <el-form-item label="地址1">
                            <el-input type="textarea" :rows="3" v-model="vdata.info.address1" />
                        </el-form-item>
                        <el-form-item label="地址2">
                            <el-input v-model="vdata.info.address2" :rows="3" type="textarea" />
                        </el-form-item>
                        <el-form-item label="地址3">
                            <el-input v-model="vdata.info.address3" type="textarea" :rows="3" />
                        </el-form-item>

                    </el-col>
                </el-row>
                <el-row>
                    <el-col>
                        <el-form-item style="float: right;">
                            <el-button type="primary" @click="nextStep" style="width: 80px;">
                                保存
                            </el-button>
                        </el-form-item>
                    </el-col>
                </el-row>

            </el-form>
        </div>
    </div>
</template>
<style lang="scss" scoped>
.user_info_main {
    width: 800px;
    margin: 0 auto;
    margin-top: 20px;
    background-color: #fff;
    padding: 20px;

    .avatar_box {
        position: relative;
        margin: 0 auto;
        width: 100px;
        /* 头像框的宽度 */
        height: 100px;

        .avatar {
            width: 100px;
            /* 头像框的宽度 */
            height: 100px;
            /* 头像框的高度 */
            border: 3px solid #fff;
            /* 头像框的边框 */
            border-radius: 50%;
            /* 头像框的圆角 */
            overflow: hidden;
            /* 确保图片不会溢出头像框 */
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
            /* 头像框的阴影效果 */
            image-rendering: pixelated;

            /* 当图片缩放时，确保像素化效果 */
            img {
                width: 100%;
                /* 图片宽度匹配头像框宽度 */
                height: 100%;
                /* 图片高度匹配头像框高度 */
            }


        }

        .label {
            position: absolute;
            position: absolute;
            bottom: 10%;
            color: #4b4848;
            background-color: #cec7c7;
            border: 1px solid #b1a8a8;
            border-radius: 5px;
            z-index: 12;
            padding: 0 5px;
            height: 20px;
            font-size: 14px;
            line-height: 20px;
            align-items: center;
        }
    }

}
</style>